//
//  Biundler+Home.swift
//  KPHome
//
//  Created by Daiyi on 2024/4/21.
//

import Foundation

extension Bundle {
    private static var _homeBundle: Bundle?
    static var homeBundle: Bundle {
        if let bundle = _homeBundle {
            return bundle
        }
        let parentBundle = Bundle(for: KPHomeController.self)
        if let path = parentBundle.path(forResource: "KPHome", ofType: "bundle"),
           let bundle = Bundle(path: path)
        {
            _homeBundle = bundle
        } else {
            _homeBundle = parentBundle
        }
        return _homeBundle ?? parentBundle
    }
}
